#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <thread>
#include <windows.h>
#include <tlhelp32.h>
#include <Psapi.h>
#include <QDesktopServices>
#include <QUrl>
#include <QRegularExpression>
#include <QRegularExpressionValidator>
#include <QFile>
#include <QMessageBox>
QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    void SetText(QString str);
    void SetText1(QString str);
    DWORD Szy_GetProcessIDW(const wchar_t* ProcessName);
    uintptr_t FindPattern(HANDLE hProcess, uintptr_t start, uintptr_t end, const std::vector<BYTE>& pattern, const std::string& mask);
    std::vector<uintptr_t> FindPatterns(HANDLE hProcess, uintptr_t start, uintptr_t end, const std::vector<BYTE>& pattern, const std::string& mask);
    void setGameProcessID(DWORD ProcessID, HMODULE moduleHandle);
    DWORD getGameProcessID();
    HMODULE Szy_GetModuleHandleW(HANDLE ProcessHandle, const wchar_t* ModuleName);
    void init();
    bool getFirst();
    void setFirst(bool toFitst);
    bool ResumeThreadHandle(DWORD dwThreadId);
    bool SuspendThreadHandle(DWORD dwThreadId);
private slots:
    void on_checkBox_stateChanged(int arg1);
    void on_checkBox_1_stateChanged(int arg1);
    void on_checkBox_2_stateChanged(int arg1);
    void on_checkBox_3_stateChanged(int arg1);
    void on_checkBox_4_stateChanged(int arg1);
    void on_radioButton_clicked();
    void on_radioButton_2_clicked();
    void on_radioButton_3_clicked();
    void on_radioButton_4_clicked();
    void on_radioButton_5_clicked();
    void on_radioButton_6_clicked();

    void on_label_4_linkActivated(const QString &link);
    void on_label_13_linkActivated(const QString &link);

private:
    Ui::Widget *ui;
    bool wxyg{false};
    bool wxtl{false};
    bool wxhp{false};
    bool wxsh{false};
    bool yjks{false};
    bool yjksIsScan{false};
    bool first{false};
    HANDLE  GameProcessHandle{0};
    DWORD  GameProcessID{0};
    HANDLE GameThread{0};
    HMODULE  ModuleHandle{0};
    HMODULE  ModuleHandle2{0};
    DWORD64 moduleBaseAddress;
};
#endif // WIDGET_H
